﻿@using System.Data;
@using DTcms.Model;
@{
   Layout = "~/Areas/admin/Views/Shared/_LayoutEdit.cshtml";
    ViewBag.Title = "Manager_Edit";
    List<SelectListItem> list = ViewData["list"] as List<SelectListItem>;
    DTcms.Model.manager m = ViewData["model"] as DTcms.Model.manager;
}
@section HeaderContent{
<script>
   $(function () {
      //初始化表单验证
      $("#form1").initValidform();
   });
</script>
}
<form id="form1" action="SubmitSave?action=@ViewBag.Action&id=@ViewBag.Id" method="post">
<!--导航栏-->
<div class="location">
  <a href="../manager_list/index" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
  <a href="../../center/index"><i class="iconfont icon-home"></i><span>首页</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <a href="../manager_list/index"><span>管理员</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <span>编辑管理员</span>
  <div class="clipboard">
     <span><label id="clipMess"></label></span>
     <a href="javascript:;" class="copy" onclick="copy();"><i class="iconfont icon-copy"></i><span>复制</span></a>
     <a href="javascript:;" class="paste disable" onclick="paste();"><i class="iconfont icon-log"></i><span>粘贴</span></a>
  </div>
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">管理员信息</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
  <dl>
    <dt>管理角色</dt>
    <dd>
      <div class="rule-single-select">
        @Html.DropDownList("ddlRoleId", new SelectList(list, "Value", "Text", m.role_id.ToString()), new { datatype = "*", errormsg = "请选择管理员角色", sucmsg = " " })
      </div>
    </dd>
  </dl>
  <dl>
    <dt>是否启用</dt>
    <dd>
      <div class="rule-single-checkbox">
         @Html.CheckBox("cbIsLock", m.is_lock == 0)
      </div>
      <span class="Validform_checktip">*不启用则无法使用该账户登录</span>
    </dd>
  </dl>
  <dl>
    <dt>用户名</dt>
    <dd>
       @Html.TextBox("txtUserName", m.user_name, new { @class = "input normal", datatype = @"/^[a-zA-Z0-9\-\_]{2,50}$/", sucmsg = " ", ajaxurl = "../../../../tools/admin_ajax.ashx?action=manager_validate" })
       <span class="Validform_checktip">*字母、下划线，不可修改</span>
    </dd>
  </dl> 
  <dl>
    <dt>登录密码</dt>
    <dd>
       @if (!string.IsNullOrEmpty(m.password)) {
         @Html.Password("txtPassword", ViewBag.DefaultPassword as string, new { @class = "input normal", datatype = "*6-20", nullmsg = "请设置密码", errormsg = "密码范围在6-20位之间", sucmsg = " " })
       }
       else {
         @Html.Password("txtPassword", "", new { @class = "input normal", datatype = "*6-20", nullmsg = "请设置密码", errormsg = "密码范围在6-20位之间", sucmsg = " " })
       }
       <span class="Validform_checktip">*</span>
    </dd>
  </dl>
  <dl>
    <dt>确认密码</dt>
    <dd> 
       @if (!string.IsNullOrEmpty(m.password)) {
          @Html.Password("txtPassword1", ViewBag.DefaultPassword as string, new { @class = "input normal", datatype = "*", recheck = "txtPassword", nullmsg = "请再输入一次密码", errormsg = "两次输入的密码不一致", sucmsg = " " })
       }
       else {
         @Html.Password("txtPassword1", "", new { @class = "input normal", datatype = "*", recheck = "txtPassword", nullmsg = "请再输入一次密码", errormsg = "两次输入的密码不一致", sucmsg = " " })
       }
       <span class="Validform_checktip">*</span>
    </dd>
  </dl>
  <dl>
    <dt>姓名</dt>
    <dd>
       @Html.TextBox("txtRealName", "", new { @class = "input normal" })
    </dd>
  </dl>
  <dl>
    <dt>电话</dt>
    <dd>
       @Html.TextBox("txtTelephone", m.telephone, new { @class = "input normal" })
    </dd>
  </dl>
  <dl>
    <dt>邮箱</dt>
    <dd>
       @Html.TextBox("txtEmail", m.email, new { @class = "input normal" })
    </dd>
  </dl>
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <input type="submit" id="btnSubmit" class="btn" value="提交保存" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
  </div>
</div>
<!--/工具栏-->
</form>
